<?php
/**
 * Created by PhpStorm.
 * User: huyang
 * Date: 16/10/29
 * Time: 上午11:13
 */

namespace App\Http\Requests\Api;

use Illuminate\Foundation\Http\FormRequest;

class EncryptDTO extends FormRequest
{

    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     * 'groupId', 'name', 'email', 'mobile'
     * @return array
     */
    public function rules()
    {
        return [
            'openId' => 'required|size:28',//产品数量
            'recommendId' => 'integer',
            'iv' => 'required',//产品数量
            'encryptedData' => 'required',//产品数量
        ];
    }

    public function messages()
    {
        return [
            'openId.required' => 'openid不能为空',
            'openId.size' => 'openid不合法',
            'recommendId.integer' => '推荐人ID不合法',
            'iv.required' => 'iv不能为空',
            'encryptedData.required' => '加密消息不能为空',
        ];
    }

}